package cn.num;

public class TestMain {

	public static void main(String[] args) {
		int[] a={1,2,3,4,5,6,7,8,9};
		fun(a,0);
	}
    public static void fun(int[] a,int start){
      if(start==a.length){
     	  doShow(a);
    	  return ;  
      }	
      for(int i=start;i<a.length;i++){
    	  {int t=a[i];a[i]=a[start];a[start]=t;}
    	    fun(a,start+1);
    	  {int t=a[i];a[i]=a[start];a[start]=t;}
      }		
    }
    //Logic
    public  static void doShow(int[] a){
    	int num1=Integer.valueOf(a[0]+a[1]+a[2]+"");
        int num2=Integer.valueOf(a[3]+a[4]+"");
        int num3=Integer.valueOf(a[5]+a[6]+a[7]+a[8]+"");
        if(num1*num2==num3){
        	System.out.println(num1+"*"+num2+"="+num3);
        }else{
        	System.gc();
        	System.out.println("goon...");
        }
    }
}
